@{
    ViewData["Title"] = "Agent";
}
<div class="row">
    <div class="col-sm-8">
        <h5>
            Agent
            <small></small>
        </h5>
    </div>
</div>
<br/>
<div class="row">
    <div class="col-md-12">
        <table class="table table-bordered" style="width: 100%">
            <thead>
            <tr>
                <th style="width: 5px">#</th>
                <th>ID</th>
                <th>NAME</th>
                <th>CORE</th>
                <th>TOTAL MEM</th>
                <th>CREATIONTIME</th>
                <th>HEARTBEART</th>
                <th style="width: 220px">ACTION</th>
            </tr>
            </thead>
            <tbody>
            <tr v-if="items.length===0">
                <td colspan="8">None</td>
            </tr>
            <tr :id="item.id" v-else v-for="item in items">
                <td v-if="item.online" class="badge-success"></td>
                <td v-else class="badge-warning"></td>
                <td v-text="item.id"></td>
                <td v-text="item.name"></td>
                <td v-text="item.processorCount"></td>
                <td v-text="item.totalMemory"></td>
                <td v-text="item.creationTime"></td>
                <td v-text="item.lastModificationTime"></td>
                <td>
                    <a title="heartbeat" class="btn btn-sm btn-outline-primary" :href="'/agents/' + item.id + '/heartbeats'">
                        <i class="fa fa-fw fa-heartbeat"></i>
                    </a>
                    <button title="remove" class="btn btn-sm btn-outline-primary" v-on:click="remove">
                        <i class="fa fa-fw fa-trash"></i>
                    </button>
                    <button title="exit" class="btn btn-sm btn-outline-primary" v-on:click="exit">
                        <i class="fa fa-fw fa-stop-circle-o"></i>
                    </button>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="row" v-if="count > limit">
    <div class="col-md-12">
        <pagination :page="page" :count="count" :limit="limit"></pagination>
    </div>
</div>

@section scripts{
    <environment names="Development">
        <script src="~/js/agent.js" asp-append-version="true"></script>
    </environment>
    <environment names="Staging,Production">
        <script src="~/js/agent.min.js" asp-append-version="true"></script>
    </environment>
}